<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
</head>

<body>
  <div id="root">
    <input type="text" v-model="obj.a">
    <div>{{name}}</div>
    <div>{{obj.a}}</div>
    <div>{{arr}}</div>
    <!-- <div></div> -->
  </div>
  <script>
    const vm = new Vue({
      el: "#root",
      data: {
        name: "tom",
        obj: {
          a: 1
        },
        arr: [1, 2, 3]
      },
      methods: {
        fn() {
          // this.obj.b = 2
          this.arr[1] = 0
        }
      }
    })

    console.log(vm.$el)
    console.log(vm.$data)

    // 1. 对象添加/删除属性，数据改变，视图不会更新
    // 2. 数组通过下标直接改变数据
    // vm.fn()
  </script>
</body>

</html>